package com.yue.test;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;


import com.yue.test.databinding.Vp2BannerBinding;

import java.util.ArrayList;
import java.util.List;

public class BannerAdapter extends RecyclerView.Adapter<BannerAdapter.MeViewHolder> {

    private List<String> list = new ArrayList<>();

    public BannerAdapter() {
        list.add("Hello");
        list.add("Hello");
        list.add("Hello");
    }

    @NonNull
    @Override
    public MeViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        Vp2BannerBinding binding = Vp2BannerBinding.inflate(LayoutInflater.from(parent.getContext()),parent,false);
        MeViewHolder viewHolder = new MeViewHolder(binding.getRoot());
        return viewHolder;
    }

    @Override
    public void onBindViewHolder(@NonNull MeViewHolder holder, int position) {

    }

    @Override
    public int getItemCount() {
        return list.size();
    }

    protected static class MeViewHolder extends RecyclerView.ViewHolder {
        public MeViewHolder(@NonNull View itemView) {
            super(itemView);
        }
    }
}
